<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>

<script type="text/javascript" src="../jstree/_lib/jquery.js"></script>
<script type="text/javascript" src="../jstree/_lib/jquery.cookie.js"></script>
<script type="text/javascript" src="../jstree/_lib/jquery.hotkeys.js"></script>
<script type="text/javascript" src="../jstree/jquery.jstree.js"></script>
<link type="text/css" rel="stylesheet"
	href="../jstree/_docs/syntax/!style.css" />
<link type="text/css" rel="stylesheet" href="../jstree/_docs/!style.css" />
<script type="text/javascript" src="../_docs/syntax/!script.js"></script>


<script type="text/javascript">
	data = [ {
		"data" : "Basics",
		"state" : "closed",
		"children" : [ {
			"data" : "login",
			"state" : "closed",
			"children" : [ "login", {
				"data" : "results",
				"state" : "closed",
				"attr" : {
					"id" : "node-123"
				}
			} ]
		},

		{
			"data" : "Basics",
			"state" : "closed",
			"children" : [ "login", "something", {
				"data" : "results",
				"state" : "closed",
				"attr" : {
					"id" : "node-456"
				}
			} ]
		} ]
	}, {
		"data" : "All",
		"state" : "closed",
		"children" : [ {
			"data" : "AddCustomer",
			"state" : "closed",
			"children" : [ "login", "Add", {
				"data" : "results",
				"state" : "closed",
				"attr" : {
					"id" : "node-789"
				}
			} ]
		} ]
	} ]

	$(function() {
		$("#jstree").jstree(
				{
					"json_data" : {
						"data" : data,
						"ajax" : {
							"url" : "/echo/json/",
							"data" : function(n) {
								// get parent / grandparent node
								var lists = $(n).parents('ul');
								var p = $(lists[0]).prev('a');
								var gp = $(lists[1]).prev('a');
								// the result is fed to the AJAX request 'data' option
								return {
									"parent" : $.trim(p.text()),
									"grandparent" : $.trim(gp.text()),
									"id" : n.attr ? n.attr("id").replace(
											"node-", "") : 1,

								};
							}
						}
					},
					"plugins" : [ "themes", "json_data" ]
				});
	});
</script>
</head>

<body>

	<h2>Issue</h2>

	<div id="jstree"></div>
</body>

</html>